﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ApprovalProcessEdit.ascx.cs" Inherits="CentralOffice.WebClient.Admin.Flow.ApprovalProcessEdit" %>

<table class="TableBlock" width="90%" align="center">
<tr>
    <td class="TableData" width=15%>审批对象：</td><td class="TableData" ><asp:DropDownList ID="ddlApprovalObject" runat="server"></asp:DropDownList></td>
    <td class="TableData" width=15%>审批名称：</td><td class="TableData"><asp:TextBox ID="txtName" runat="server" CssClass="BigInput" Width="80%" ></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="必须填写审批名称" ControlToValidate="txtName">*</asp:RequiredFieldValidator><span class="warning">(必填)</span></td>
</tr>
    <tr>
        <td nowrap class="TableData" >
            紧急程度：
        </td>
        <td nowrap class="TableData">
            <asp:DropDownList ID="ddlUrgencyDegree" runat="server">
            </asp:DropDownList>
        </td>
        <td class="TableData">
            执行人：
        </td>
        <td class="TableData">
            <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" RenderMode="Inline">
                <ContentTemplate>
                    <input type="text" id="txtEmpReadOnly" style="width: 60%" name="txtExecutorReadOnly"
                        class="SmallStatic" runat="server" readonly="readonly" />
                    <asp:HiddenField ID="txtEmp" runat="server" />
                    &nbsp;
                    <asp:LinkButton ID="btnShowPopup" CommandName="ApprovedBy" runat="server" OnClick="btnShowPopup_Click"
                        CssClass="orgAdd">选择</asp:LinkButton>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="btnEmpOK" />
                </Triggers>
            </asp:UpdatePanel>
            &nbsp; <a href="javascript:;" class="orgClear" onclick="$get('<%= txtEmpReadOnly.ClientID %>').value='';$get('<%= txtEmp.ClientID %>').value='';">
                清空</a>
        </td>
    </tr>
<%--
<tr>
    <td class="TableData">文档号：</td><td class="TableData"><asp:TextBox ID="txtFileNumber" runat="server" CssClass="BigInput" style="width:60%;"></asp:TextBox></td>
    <td class="TableData">密级：</td><td class="TableData"><asp:DropDownList ID="ddlSecretLevel" runat="server"></asp:DropDownList></td>   
</tr>
--%>
<tr align="center" class="TableControl">
    <td colspan="4">
        <asp:Button ID="btnSave" runat="server" Text="保存"  CssClass="BigButton" 
            onclick="btnSave_Click" />
        <input type="button" value="取消" class="BigButton" style="margin-left:65px;" onclick="window.parent.location='default.htm';" />
    </td>
</tr>
</table>
<asp:Literal ID="lblJavaScript" EnableViewState="false" runat="server"></asp:Literal>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" EnableViewState="false" />

<asp:Panel ID="pnlPopup" runat="server" CssClass="x-pne" Style="display: none; width: 460px;">
    <asp:UpdatePanel ID="updPnlDepartment" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:Button ID="btnShowEdit" runat="server" Style="display: none" />
            <ajaxToolkit:ModalPopupExtender ID="mdlDetailView" runat="server" BehaviorID="detailView"
                TargetControlID="btnShowEdit" PopupControlID="pnlPopup" CancelControlID="btnEmpCancel"
                BackgroundCssClass="modalBackground" PopupDragHandleControlID="pnlDrag" />
            <asp:Panel ID="pnlDrag" runat="server" CssClass="corner-bg x-pne-lt x-pne-left">
                <div class="corner-bg x-pne-rt x-pne-right">
                    <div class="corner-bg x-pne-t dragTitle">
                        <div class="x-pne-btn" id="Div3" onclick="$find('detailView').hide();">
                        </div>
                        <div class="x-pne-caption font dragTitle">
                            <span>请选择审批者</span></div>
                    </div>
                </div>
            </asp:Panel>
            <div>
                <div class="side-bg x-pne-l">
                    <div class="side-bg x-pne-r">
                        <div class="x-pne-c" style="width: 448px;">
                            <div style="margin: 10px; font-size: 9pt;" class="wrapper">
                                <div id="div4" style="width: 430px; height: 300px; overflow: auto;">
                                    <asp:TreeView ID="tvEmp" runat="server" EnableViewState="true" OnLoad="tvEmp_Load">
                                    </asp:TreeView>
                                </div>
                                <!-- 下面是确认按钮 -->
                                <div style="width: 328px; margin-top: 16px;">
                                    <table style="width: 100%; margin-left: 40px;">
                                        <tr>
                                            <td>
                                                <div class="btn-side btn-bg">
                                                </div>
                                                <div class="btn-body btn-bg" style="background-position: 0px 168px; width: 66px">
                                                    <asp:Button ID="btnEmpOK" runat="server" Text="  确定  " CssClass="font" OnClick="btnOK_Click" /></div>
                                                <div class="btn-side btn-bg" style="background-position: 0px 189px">
                                                </div>
                                            </td>
                                            <td>
                                                <div class="btn-side btn-bg">
                                                </div>
                                                <div class="btn-body btn-bg" style="background-position: 0px 168px; width: 66px;">
                                                    <asp:Button ID="btnEmpCancel" runat="server" Text="  取消  " CssClass="font" /></div>
                                                <div class="btn-side btn-bg" style="background-position: 0px 189px">
                                                </div>
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="corner-bg x-pne-lb x-pne-left">
                    <div class="corner-bg x-pne-rb x-pne-right">
                        <div class="corner-bg x-pne-b">
                        </div>
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Panel>
<asp:UpdateProgress ID="updateProgress" runat="server">
    <ProgressTemplate>
        <div id="progressBackgroundFilter">
        </div>
        <div id="processMessage">
            正在处理数据，请稍等...<br />
            <br />
            <img alt="Loading" src="../images/loading_16.gif" /></div>
    </ProgressTemplate>
</asp:UpdateProgress>


<script type="text/javascript">
    function selectAll() {
        var tree = document.getElementById("<%=tvEmp.ClientID%>");
        if (typeof (tree) === "undefined" && tree === null) return;

        var checkBoxs = tree.getElementsByTagName('INPUT');
        for (var i = 0; i < checkBoxs.length; i++) {
            if (checkBoxs[i].type == "checkbox") {
                checkBoxs[i].checked = true;
            }
        }
    }

    function reverse() {
        var tree = document.getElementById("<%=tvEmp.ClientID%>");
        if (typeof (tree) === "undefined" && tree === null) return;

        var checkBoxs = tree.getElementsByTagName('INPUT');
        for (var i = 0; i < checkBoxs.length; i++) {
            if (checkBoxs[i].type == "checkbox") {
                checkBoxs[i].checked = !checkBoxs[i].checked;
            }
        }
    }

    function OnTreeNodeChecked() {
        var ele = window.event.srcElement;
        if (ele.type == 'checkbox') {
            var childrenDivID = ele.id.replace('CheckBox', 'Nodes');
            var div = document.getElementById(childrenDivID);
            if (div == null) return;
            var checkBoxs = div.getElementsByTagName('INPUT');
            for (var i = 0; i < checkBoxs.length; i++) {
                if (checkBoxs[i].type == 'checkbox')
                    checkBoxs[i].checked = ele.checked;
            }
        }
    }

    function validateClient() {
        if (document.getElementById("txtExecutor").value.length == 0) {
            alert("必须选定执行者！");
            return false;
        }
        return true;
    }
</script>
